class Main extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            showmodal: !1,
            showmodal1: !1,
            isandroid: !0,
        };
    }



    componentDidMount() {

        localStorage.removeItem('token')
        localStorage.removeItem('userid')
        localStorage.removeItem('phone')
        window.location.href='./index.html'
    }

    inputchange(e) {
        this.setState({ phone: e.target.value })

    }
    cbchange(e) {
        //console.log('cbchange', e.target.checked);
        this.setState({ isagree: e.target.checked })
    }

    toxieyi(e) {
        // window.location.href='./xieyi.html?t='+e
    }

    submit() {
        if (!this.state.isagree) {
            alert('请先勾选同意协议')
        } else {
            let { phone } = this.state, err = ''
            if (phone.length != 11) { err = '手机号输入有误' }
            if (err != '') {
                alert(err)
            } else {
                bind(phone, res => {
                    console.log(res, 'resres--bind');

                    if (res.issuccess == 1) {
                        localStorage.setItem('userid', res.userid)
                        localStorage.setItem('phone', phone)
                        localStorage.setItem('token', res.token)
                        this.setState({showmodal:!1,showmodal1:!0})
                        // window.location.href = './main.html'
                    } else {
                        alert(res.msg)
                    }
                })

            }

        }
    }









    render() {
        let { phone, showmodal, isagree, showmodal1 } = this.state;
        return (
            <div className="all">

            </div>


        )
    }
}

ReactDOM.render(
    <div>
        {/* <TopLine /> */}
        <div id='body'>

            <Main />
        </div>
    </div>
    // <Barrage />
    , $('.container')[0]
)